package com.qumap.item.event;

import com.google.gwt.event.shared.GwtEvent;

/**
 * Created by IntelliJ IDEA.
 * User: Admin
 * Date: 11.05.11
 * Time: 15:55
 * To change this template use File | Settings | File Templates.
 */
public class ItemEventCollection {

	private static class ItemEventType extends GwtEvent.Type<ItemEventHandler> {}


	public static enum EventType {
        ClearTyped,
		Created,
		AddedToMap,
        Load,
        Saved,
        Updated,
		Select,
		Delete,
        ItemTypeRegistered;

		private GwtEvent.Type<ItemEventHandler> gwt_event_type = new ItemEventType();

		public GwtEvent.Type<ItemEventHandler> getType() {
			return gwt_event_type;
		}
	}

	private static final ItemEventCollection self = new ItemEventCollection();

	private ItemEventCollection() {
	}

	public static ItemEventCollection getCollection() {
		return self;
	}

	public ItemEvent getEvent(EventType type) {
		return new ItemEvent(type.getType());
	}


}
